#include <bits/stdc++.h>

using namespace std;

// #define LOCK_GETCHAR
// #define USE_INT_128

#if __cplusplus < 201400
#warning "Please use c++14 or higher."
#define CONSTEXPR_FUNC
#define ENABLE_IF_INT
#else
#define CONSTEXPR_FUNC constexpr
#define ENABLE_IF_INT , enable_if_t<_is_integer<T>, int> = 0
template <class T> constexpr bool _is_integer = numeric_limits<T>::is_integer;
template <> constexpr bool _is_integer<bool> = false;
template <> constexpr bool _is_integer<char> = false;
#ifdef USE_INT_128
template <> constexpr bool _is_integer<__int128> = true;
template <> constexpr bool _is_integer<__uint128_t> = true;
#endif
#endif

#if !defined(_WIN32) && !defined(LOCK_GETCHAR)
#define getchar getchar_unlocked
#endif

#define il inline
#define mkp make_pair
#define fi first
#define se second
#define For(i, j, k) for (decltype(j - k) i = (j); i <= (k); ++i)     // NOLINT
#define ForDown(i, j, k) for (decltype(j - k) i = (j); i >= (k); --i) // NOLINT
#define eb emplace_back
#ifndef ONLINE_JUDGE
#define FileIO(filename)                                                       \
  freopen(filename ".in", "r", stdin);                                         \
  freopen(filename ".out", "w", stdout)
#else
#define FileIO(filename) void(0)
#endif

using ll = long long;
using uint = unsigned int;
using ull = unsigned long long;
using db = double;
using ldb = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#ifdef USE_INT_128
using lll = __int128_t;
using ulll = __uint128_t;
#endif

// clang-format off
CONSTEXPR_FUNC il ll qpow(ll x, ull y, ll mod){ ll ans = 1; x %= mod; while (y) { if (y & 1) (ans *= x) %= mod; (x *= x) %= mod; y >>= 1; } return ans; }
template<typename T> CONSTEXPR_FUNC il void cmin(T & x, const T &y){ x = min(x, y); }
template<typename T> CONSTEXPR_FUNC il void cmax(T & x, const T &y){ x = max(x, y); }
template<typename T ENABLE_IF_INT> il void read(T &x){ x = 0; int f = 1; int c = getchar(); while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); } x *= f; }
il void read(string &s) { s = ""; char ch = getchar(); while (isspace(ch)) ch = getchar(); while (!isspace(ch)) s += ch, ch = getchar(); }
il void read(char *s) { int ch = getchar(), p = 0; while (isspace(ch)) ch = getchar(); while (!isspace(ch)) s[p++] = ch, ch = getchar(); }
template<typename T, typename ... Args> il void read(T &x, Args &... y){ read(x), read(y...); }
// clang-format on

// File head end

namespace {
constexpr ll MAXN = 1e5 + 5;
int __id, n, q, cnt = 0;
pii X[MAXN], Y[MAXN];
pair<pii, pii> a[MAXN];
vector<pii> op[MAXN];
vector<int> pool;

struct Node {
  ll l, r, tag, minv, cnt, ans;
  Node() : l(0), r(0), tag(0), minv(0), cnt(0), ans(0) {}
} T[MAXN << 4];
#define lc(p) ((p) << 1)
#define rc(p) ((p) << 1 | 1)
il void pu(int p) {
  T[p].ans = T[lc(p)].ans + T[rc(p)].ans;
  T[p].minv = min(T[lc(p)].minv, T[rc(p)].minv);
  T[p].cnt = 0;
  if (T[lc(p)].minv == T[p].minv)
    T[p].cnt += T[lc(p)].minv;
  if (T[rc(p)].minv == T[p].minv)
    T[p].cnt += T[rc(p)].minv;
}
il void f(int p, ll tg) {
  T[p].tag += tg;
  T[p].minv += tg;
  T[p].ans = (pool[T[p].r] - pool[T[p].l - 1]);
  if (!T[p].minv)
    T[p].ans -= T[p].cnt;
}
il void pd(int p) {
  assert(p);
  if (!T[p].tag)
    return;
  f(lc(p), T[p].tag), f(rc(p), T[p].tag);
}
void build(int p, int l, int r) {
  T[p] = {};
  T[p].l = l, T[p].r = r;
  if (l == r)
    return T[p].cnt = (pool[r] - pool[l - 1]), void();
  int mid = (l + r) >> 1;
  build(lc(p), l, mid), build(rc(p), mid + 1, r);
  pu(p);
}
il void upd(int p, int ql, int qr, int v) {
  int l = T[p].l, r = T[p].r;
  if (ql <= l && qr >= r)
    return f(p, v);
  pd(p);
  int mid = (l + r) >> 1;
  if (ql <= mid)
    upd(lc(p), ql, qr, v);
  if (qr > mid)
    upd(rc(p), ql, qr, v);
  pu(p);
}

il void calc() {
  build(1, 1, pool.size() - 1);
  cnt = 0;
  ll ans = 0, pre = 0;
  For(i, 1, pool.size()) {
    ans += (ll)T[1].ans * (pool[i - 1] - pre);
    pre = pool[i - 1];
    for (pii u : op[i]) {
      if (u.fi > 0)
        upd(1, u.fi, u.se, 1);
      else
        upd(1, -u.fi, -u.se, -1);
    }
  }
  cout << ans << '\n';
}

il void Main() {
  FileIO("dierti");
  read(__id, n, q);
  For(i, 1, n) {
    read(a[i].fi.fi, a[i].fi.se, a[i].se.fi, a[i].se.se);
    pool.eb(a[i].fi.fi), pool.eb(a[i].se.fi);
    pool.eb(a[i].fi.se), pool.eb(a[i].se.se);
  }

  sort(pool.begin(), pool.end());
  pool.erase(unique(pool.begin(), pool.end()), pool.end());
  auto trans = [&](int x) {
    return lower_bound(pool.begin(), pool.end(), x) - pool.begin() + 1;
  };
  For(i, 1, n) {
    X[i].fi = trans(a[i].fi.fi), X[i].se = trans(a[i].se.fi);
    Y[i].fi = trans(a[i].fi.se), Y[i].se = trans(a[i].se.se);
  }

  while (q--) {
    int l, r;
    read(l, r);
    For(i, l, r) {
      op[X[i].fi].eb(Y[i].fi, Y[i].se - 1);
      op[X[i].se].eb(Y[i].fi, Y[i].se - 1);
    }
    calc();
    For(i, l, r) {
      op[X[i].fi].pop_back();
      op[X[i].se].pop_back();
    }
  }
}
} // namespace

signed main() { return Main(), 0; }
